<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/init.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<jsp:include page="/WEB-INF/jsp/common/common.jsp" />
<jsp:include page="/WEB-INF/jsp_lib/tip.jsp" />
<script type="text/javascript">
	function query() {
		$("#form1").submit();
	}
	function getResult(verify_id) {
		$("input[name='verify_id']").val(verify_id);
		var url = "${path}/ix/verify/result.htm";
		$("#form1").attr("action", url);
		$("#form1").submit();
	}
	function selectAll() {
		var all = document.getElementById("choose");
		var allIds = document.getElementsByName("check_id");
		for (var i = 0; i < allIds.length; i++) {
			allIds[i].checked = all.checked;
		}
	}
	function result_form_yes() {
		var check_ids = "";
		var $check_ids = $("input[name='check_id']:checked");
		$.each($check_ids, function(i, n) {
			check_ids += $(this).val() + ",";
		});
		if (check_ids.length > 0) {
			$("input[name='check_ids']").val(check_ids);
			var url = "${path}/ix/verify/result_form.htm?type=yes";
			$("#form1").attr("action", url);
			$("#form1").submit();
		} else {
			ohSnap("请选择需审核的机构！", "warning");
		}
	}
	function result_form_no() {
		var check_ids = "";
		var $check_ids = $("input[name='check_id']:checked");
		$.each($check_ids, function(i, n) {
			check_ids += $(this).val() + ",";
		});
		if (check_ids.length > 0) {
			$("input[name='check_ids']").val(check_ids);
			var url = "${path}/ix/verify/result_form.htm?type=no";
			$("#form1").attr("action", url);
			$("#form1").submit();
		} else {
			ohSnap("请选择需审核的机构！", "warning");
		}
	}
</script>
</head>
<body>
	<div>
		<form action="${path}/ix/verify/list.htm" id="form1" method="post">
			<input name='verify_id' type="hidden" />
			<input name='check_ids' type="hidden" />
			<h2>
				<div>机构审核</div>
			</h2>
			<%-- <div class="query">
				<table width="100%" border="0" align="center" cellpadding="0" cellspacing="5">
					<tr>
						<td width="60" align="right">
							<strong>标题：</strong>
						</td>
						<td width="200" align="left">
							<input name="srh_name" type="text" /> 
						</td>
						<td align="left">
							<a href="javascript:query();">
								<img src="${path}/style_cp/img/query.jpg" name="Image4" width="85" height="27" border="0" id="Image4" /> 
							</a>
						</td>
					</tr>
				</table>
			</div> --%>
			<table width="100%" class="listlindex">
				<tr>
					<th><input type="checkbox" id="choose" onclick="selectAll()" /></th>
					<th>机构编号</th>
					<th>机构名称</th>
					<th>机构类型</th>
					<th>机构级别</th>
					<th>省级代码</th>
					<th>区域</th>
					<th>审核类型</th>
					<th>上级机构</th>
					<th>操作</th>
				</tr>
				<c:if test="${fn:length(list)==0}">
					<tr>
						<td colspan="10"><div class="tip_div">暂无记录.</div></td>
					</tr>
				</c:if>
				<c:forEach items="${list}" var="v">
					<tr>
						<td><input type="checkbox" name="check_id" value="${v._id}" /></td>
						<td>${v.code}</td>
						<td>${v.name}</td>
						<td>${v.type}</td>
						<td>${v.level_name}</td>
						<td>${v.city_code}</td>
						<td>${v.area}</td>
						<td>${v.flag_note}</td>
						<td>${v.super_name}</td>
						<td><c:if test="${v.flag==null }">
								<a href="javascript:getResult('${v._id}');" class="asave">
									【操作】 </a>
							</c:if></td>
					</tr>
				</c:forEach>
			</table>
			<div id="response"></div>
			<div class="options">
				<div class="quotes">
					<a href="javascript:result_form_yes();" class="asave"
						style="float:left"> 【通过】 </a> <a
						href="javascript:result_form_no();" class="asave"
						style="float:left"> 【不通过】 </a>
					<page:page page="${page}" />
				</div>
				<div class="clear"></div>
			</div>
		</form>
</body>
</html>